.class public abstract Lcom/estrongs/android/scanner/service/a;
.super Ljava/lang/Object;
.source "BaseFileObserver.java"


# static fields
.field private static final c:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap<",
            "Ljava/io/File;",
            "Ljava/util/Set<",
            "Lcom/estrongs/android/scanner/service/a;",
            ">;>;"
        }
    .end annotation
.end field

.field private static final d:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap<",
            "Ljava/io/File;",
            "Landroid/os/FileObserver;",
            ">;"
        }
    .end annotation
.end field


# instance fields
.field private final a:Ljava/io/File;

.field private final b:I


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 1
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lcom/estrongs/android/scanner/service/a;->c:Ljava/util/HashMap;

    .line 2
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lcom/estrongs/android/scanner/service/a;->d:Ljava/util/HashMap;

    return-void
.end method

.method public constructor <init>(Ljava/lang/String;)V
    .locals 1

    const/16 v0, 0xfff

    .line 1
    invoke-direct {p0, p1, v0}, Lcom/estrongs/android/scanner/service/a;-><init>(Ljava/lang/String;I)V

    return-void
.end method

.method public constructor <init>(Ljava/lang/String;I)V
    .locals 1

    .line 2
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 3
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    iput-object v0, p0, Lcom/estrongs/android/scanner/service/a;->a:Ljava/io/File;

    .line 4
    iput p2, p0, Lcom/estrongs/android/scanner/service/a;->b:I

    return-void
.end method

.method static synthetic a(Lcom/estrongs/android/scanner/service/a;ILjava/lang/String;)V
    .locals 0

    .line 1
    invoke-direct {p0, p1, p2}, Lcom/estrongs/android/scanner/service/a;->b(ILjava/lang/String;)V

    return-void
.end method

.method private b(ILjava/lang/String;)V
    .locals 4
    .param p2    # Ljava/lang/String;
        .annotation build Landroidx/annotation/Nullable;
        .end annotation
    .end param

    .line 1
    sget-object v0, Lcom/estrongs/android/scanner/service/a;->c:Ljava/util/HashMap;

    monitor-enter v0

    .line 2
    :try_start_0
    sget-object v1, Lcom/estrongs/android/scanner/service/a;->c:Ljava/util/HashMap;

    iget-object v2, p0, Lcom/estrongs/android/scanner/service/a;->a:Ljava/io/File;

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/Set;

    .line 3
    invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_0
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/estrongs/android/scanner/service/a;

    .line 4
    iget v3, v2, Lcom/estrongs/android/scanner/service/a;->b:I

    and-int/2addr v3, p1

    if-eqz v3, :cond_0

    .line 5
    invoke-virtual {v2, p1, p2}, Lcom/estrongs/android/scanner/service/a;->a(ILjava/lang/String;)V

    goto :goto_0

    .line 6
    :cond_1
    monitor-exit v0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_2

    :goto_1
    throw p1

    :goto_2
    goto :goto_1
.end method


# virtual methods
.method public a()V
    .locals 5

    .line 2
    sget-object v0, Lcom/estrongs/android/scanner/service/a;->c:Ljava/util/HashMap;

    monitor-enter v0

    .line 3
    :try_start_0
    sget-object v1, Lcom/estrongs/android/scanner/service/a;->d:Ljava/util/HashMap;

    iget-object v2, p0, Lcom/estrongs/android/scanner/service/a;->a:Ljava/io/File;

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/os/FileObserver;

    if-nez v1, :cond_0

    .line 4
    new-instance v1, Lcom/estrongs/android/scanner/service/a$a;

    iget-object v2, p0, Lcom/estrongs/android/scanner/service/a;->a:Ljava/io/File;

    invoke-virtual {v2}, Ljava/io/File;->getPath()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, p0, v2}, Lcom/estrongs/android/scanner/service/a$a;-><init>(Lcom/estrongs/android/scanner/service/a;Ljava/lang/String;)V

    .line 5
    sget-object v2, Lcom/estrongs/android/scanner/service/a;->d:Ljava/util/HashMap;

    iget-object v3, p0, Lcom/estrongs/android/scanner/service/a;->a:Ljava/io/File;

    invoke-virtual {v2, v3, v1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 6
    :cond_0
    sget-object v2, Lcom/estrongs/android/scanner/service/a;->c:Ljava/util/HashMap;

    iget-object v3, p0, Lcom/estrongs/android/scanner/service/a;->a:Ljava/io/File;

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Set;

    if-nez v2, :cond_1

    .line 7
    new-instance v2, Ljava/util/HashSet;

    invoke-direct {v2}, Ljava/util/HashSet;-><init>()V

    .line 8
    :cond_1
    invoke-interface {v2, p0}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    .line 9
    sget-object v3, Lcom/estrongs/android/scanner/service/a;->c:Ljava/util/HashMap;

    iget-object v4, p0, Lcom/estrongs/android/scanner/service/a;->a:Ljava/io/File;

    invoke-virtual {v3, v4, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 10
    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz v1, :cond_2

    .line 11
    invoke-virtual {v1}, Landroid/os/FileObserver;->startWatching()V

    :cond_2
    return-void

    :catchall_0
    move-exception v1

    .line 12
    :try_start_1
    monitor-exit v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v1
.end method

.method public abstract a(ILjava/lang/String;)V
.end method

.method public b()V
    .locals 3

    .line 7
    sget-object v0, Lcom/estrongs/android/scanner/service/a;->c:Ljava/util/HashMap;

    monitor-enter v0

    .line 8
    :try_start_0
    sget-object v1, Lcom/estrongs/android/scanner/service/a;->c:Ljava/util/HashMap;

    iget-object v2, p0, Lcom/estrongs/android/scanner/service/a;->a:Ljava/io/File;

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/Set;

    if-nez v1, :cond_0

    .line 9
    monitor-exit v0

    return-void

    .line 10
    :cond_0
    invoke-interface {v1, p0}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z

    .line 11
    invoke-interface {v1}, Ljava/util/Set;->size()I

    move-result v1

    if-nez v1, :cond_1

    .line 12
    sget-object v1, Lcom/estrongs/android/scanner/service/a;->d:Ljava/util/HashMap;

    iget-object v2, p0, Lcom/estrongs/android/scanner/service/a;->a:Ljava/io/File;

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/os/FileObserver;

    goto :goto_0

    :cond_1
    const/4 v1, 0x0

    .line 13
    :goto_0
    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz v1, :cond_2

    .line 14
    invoke-virtual {v1}, Landroid/os/FileObserver;->stopWatching()V

    :cond_2
    return-void

    :catchall_0
    move-exception v1

    .line 15
    :try_start_1
    monitor-exit v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v1
.end method
